<?php
    $nonce = base64_encode( sha1(time().rand().time()) );
    $_SESSION['nonce']= $nonce;
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>speedlk</title>
<link rel="stylesheet" type="text/css" href="css/main.css">
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="js/highcharts.js"></script>
<script type="text/javascript" src="js/jquery.flash.js"></script>
<script type="text/javascript" src="js/main.js"></script>
<script type="text/javascript">
 st.nonce = '<?php echo $_SESSION['nonce'] ?>';
$(function(){

})
</script>
</head>

<body>
<header>
<div class="wrapper clearfix">
	<h1>Speedlk</h1>
    <div id="user">
    	<a href="#" class="testspeed">Test Speed</a>
        <div id="userinfo">
        	<img src="img/temp/avatar.jpg" alt="useravatar">
            <span class="username">Welcome, <b>Thilina Gunasekara</b></span>
            <span class="userlinks">
            	<a href="#">tests</a> | 
                <a href="#">settings</a>
            </span>
        </div>
    </div>
</div>
</header>
<section id="speedtest">
	<div class="wrapper clearfix">
        <aside>
        	<div id="flashgadget">
            	<img src="img/temp/flashgadget.png" alt="flashgadget">
            </div>
            <dl>
                <dt>Network</dt>
                <dd><span class="data">SLTelecom</span></dd>
            </dl>
        </aside>
        <form>
            <dl>
                <dt><label for="location">Location</label></dt>
                <dd>
                	<input type="text" id="location" autocomplete="off">
                    <input type="hidden" id="locid" value="2">
                    <input type="hidden" id="packageid" value="2">
                </dd>
                <dt><label>Publish on</label></dt>
                <dd>
                    <label class="toggle facebook"><input type="checkbox"> facebook</label>
                    <label class="toggle twitter"><input type="checkbox"> twitter</label>
                </dd>
                <dd>
                    <button type="submit" id="submit-test">Submit speed test</button>
                </dd>
            </dl>
        </form>
	</div>
</section>
<section id="stats">
	<div class="wrapper">
        <div id="chart-ctrls" class="clearfix">
            <form action="filter.php" method="post">
                <select id="loc" name="l" class="l">
                    <?php 
                    	require ('dataaccess.php');
                 	    $locs = getLocationsForDropDown();
						for ($i = 0; $i < count($locs); $i++){
							echo "<option value=" . $locs[$i]['id'] . ">" . $locs[$i]['name'] . "</option>";
						}
                    ?>
                    
                </select>
                <select name="p" class="p" id="pkg">
                    <option value="0">All Packages</option>
                    <?php 
                    	$packages = getAllPackagesForDropDown();
						for ($i = 0; $i < count($packages); $i++){
							echo "<option value=" . $packages[$i]['id'] . ">" . $packages[$i]['name'] . "</option>";
						}
                    ?>
                </select>
            </form>
        </div>
        <div id="chart-w">
        	<div id="chart"></div>
        </div>
    </div>
</section>
<footer>

</footer>
</body>
</html>
